#!/bin/bash
if [ $# -ne 1 ];then
        echo "请输入脚本名称"
        exit 1
fi
while true;do
        sh -n $1 &>/dev/null
        if [ $? -ne 0 ];then
             sh -n $1 > /tmp/xujun.txt
             cat /tmp/xujun.txt
        read -p "请输入Q或者q,退出当前脚本: " q
            if [ "$q" == "Q" ] || [ "$q" == "q" ];then
                  exit 0
            else
                  vim $1
                  continue
            fi
        else
            echo "此脚本正常"
            break
        fi
done